home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
rsxwdk2s.zip
/
RSXWDK
/
LIBSRC
/
SYSEMX
/
FTRUNCAT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-17
|
338b
|
18 lines
#include <sys/emx.h>
#include <sys/doscalls.h>
int __ftruncate (int handle, long length)
{
long pos;
if ((pos = dos_lseek(handle, 0, 1)) == -1)
return -1;
else if (pos > length) {
if (dos_lseek(handle, length, 0) != -1L)
return dos_write(handle, &pos, 0);
else
return -1;
}
return 0;
}